package com.example.springmvcdemo.mapper;

import com.example.springmvcdemo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface MessageInfoMapper {
    // 查询所有留言

    @Select("select * from message_info where delete_flag=0")
    List<MessageInfo> queryAllMessage();

    // 插入留言信息
    @Insert("insert into message_info (`from`,`to`,`message`) values (#{from},#{to},#{message})")
    Integer insertMessage(MessageInfo messageInfo);
}
